﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace qf_cms
{
	public partial class _default : System.Web.UI.Page
	{
		LogicLayer mgr = new LogicLayer();
		protected string curTitle = "", curContent = "";

		protected void Page_Load(object sender, EventArgs e)
		{
			List<CMS_Article> artList = mgr.ListArticleInFirstColumn();
			if (artList != null && artList.Count > 0)
			{
				CMS_Article art = artList[0];
				curTitle = art.ArticleTitle;
				curContent = art.ArticleContent;
			}
		}

		protected void WriteLeftNav()
		{
			List<CMS_Article> artList = mgr.ListArticleInFirstColumn();
			if (artList != null)
			{
				string url = string.Empty;
				int i = 0;
				foreach (CMS_Article art in artList)
				{					
					url = "/templates/subArticle.aspx?aid=" + art.ArticleID;
					if (i == 0)
						Response.Write("<a href=\"#\" class=\"l1on\">" + art.ArticleTitle + "</a>");
					else
						Response.Write("<a href=\"" + url + "\" >" + art.ArticleTitle + "</a>");
					i++;
				}
			}
		}
	}
}